
package com.dfiov.cloud.msmtools.enums;

public enum EnrollStatusEnum {

    LEAVE_FACTORY(0, "出厂"),

    ACTIVATE_SUCCESS(1, "激活成功"),

    ACTIVATE_FAILURE(2, "激活失败"),

    ACTIVATING(3, "激活进行中"),

    AUDITING(4, "审核中"),

    AUDIT_FAILURE(5, "审核失败"),
    ;
    
    private Integer code;
    
    private String desc;
    
    public static String getDescByCode(Integer code) {
        
        if(code == null) {
            return null;
        }
        for (EnrollStatusEnum statusEnum : values()) {
            if(statusEnum.code == code) {
                return statusEnum.desc;
            }
        }
        return null;
    }

    private EnrollStatusEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
}
